<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LuckyFrame质量之星</title>

</head>
<body>
	<div>
		<%@ include file="/head.jsp"%>
	</div>

	<header id="head" class="secondary"></header>

	<div class="modal fade" id="checkchart" tabindex="-1" role="dialog"
					aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<h4 class="modal-title" id="myModalLabel">质量之星积分策略：</h4>
							</div>
							<div class="modal-body">
							  <form class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-12" style="font-weight:normal"><b>测试用例：</b>编辑(1分)  添加(3分)  复制(1分)  新增|编辑用例集(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>用例执行：</b>单条执行(1分) 批量执行(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>协议模板：</b>添加(5分) 复制(2分) 修改(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>公共参数：</b>添加(3分) 修改(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>测试计划：</b>添加(3分) 修改(1分) 保存计划用例(2分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>执行任务：</b>删除(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>调度任务：</b>添加(5分) 启动(2分) 关闭(1分) 执行(2分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>客户端驱动jar包：</b>上传(5分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>流程检查：</b>明细添加(2分) 批量生成明细(2分) 添加(3分) 修改(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>流程检查计划：</b>添加(2分) 修改(1分) 计划转检查(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>版本信息：</b>添加(5分) 版本信息修改(1分) 版本计划添加成功(2分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>事故登记：</b>增加(10分) 修改(1分) 上传附件(2分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>客户端：</b>增加(5分) 修改(3分) 删除(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>项目：</b>增加(3分) 修改(1分)</label>
									<label class="col-sm-12" style="font-weight:normal"><b>其他管理类操作：</b>增加(1分)</label>
								</div>
								</form>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-default"
									data-dismiss="modal">关闭</button>
							</div>
						</div>
						<!-- /.modal-content -->
					</div>
					<!-- /.modal -->
				</div>
				
	<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
	<div id="main" style="height: 600px"></div>

	<!-- ECharts单文件引入 -->
	<script src="/progressus/assets/js/echarts.min.js"></script>
	<script type="text/javascript">
    // Make dynamic data.
    
                // 基于准备好的dom，初始化echarts图表
                var myChart = echarts.init(document.getElementById('main')); 
                var loadingTicket;
                var effect = ['Loadding','不要催我，慢跑中','正在加载中','数据都去哪儿了'];
                var random = Math.floor(Math.random()*effect.length);

                myChart.showLoading({
                    text : effect[random],
                    effect : effect[random],
                    textStyle : {
                        fontSize : 20
                    }
                });
                
                var spirit = 'image://';

                var option;
        		jQuery(function getshowdata(){
        			var url ="/operationLog/getautostar.do";
        			$.ajax({
        				type:"GET",
        				url:url,
        				async: false,
        				cache:false,
        				dataType:"json",
        				success:function (result){
        					option = {
        			                   "title": {
        			                      "text": "LuckyFrame质量之星",
        			                      "subtext": "积分排行榜   From LuckyFrame",
        			                      "left": "center",
        			                      "y": "10",
        			                      "textStyle": {
        			                        "color": "#fff"
        			                      }
        			                    },
        			                    "backgroundColor": "#101a3c",
        			                    "grid": {
        			                      "left": "10%",
        			                      "top": "10%",
        			                      "bottom": "5%"
        			                    },
        			                    "tooltip": {
        			                      "trigger": "item",
        			                      "textStyle": {
        			                        "fontSize": 12
        			                      },
        			                      "formatter": "{b0}:{c0}"
        			                    },
        			                    "xAxis": {
        			                      "max": result.maxvalue,
        			                      "splitLine": {
        			                        "show": false
        			                      },
        			                      "axisLine": {
        			                        "show": false
        			                      },
        			                      "axisLabel": {
        			                        "show": false
        			                      },
        			                      "axisTick": {
        			                        "show": false
        			                      }
        			                    },
        			                    "yAxis": [
        			                      {
        			                        "type": "category",
        			                        "inverse": false,
        			                        "data": result.name,
        			                        "axisLine": {
        			                          "show": false
        			                        },
        			                        "axisTick": {
        			                          "show": false
        			                        },
        			                        "axisLabel": {
        			                          "margin": -4,
        			                          "textStyle": {
        			                            "color": "#fff",
        			                            "fontSize": 12
        			                          }
        			                        }
        			                      },
        			                    
        			                    ],
        			                    "series": [
        			                      {
        			                        "type": "pictorialBar",
        			                        "symbol": spirit,
        			                        "symbolRepeat": "fixed",
        			                        "symbolMargin": "5%",
        			                        "symbolClip": true,
        			                        "symbolSize": 22.5,
        			                        "symbolPosition": "start",
        			                        "symbolOffset": [
        			                          20,
        			                          0
        			                        ],
        			                        "symbolBoundingData": result.maxvalue,
        			                        "data":  result.integral,
        			                        "z": 10
        			                      },
        			                      {
        			                        "type": "pictorialBar",
        			                        "itemStyle": {
        			                          "normal": {
        			                            "opacity": 0.3
        			                          }
        			                        },
        			                        "label": {
        			                          "normal": {
        			                            "show": false
        			                          }
        			                        },
        			                        "animationDuration": 0,
        			                        "symbolRepeat": "fixed",
        			                        "symbolMargin": "5%",
        			                        "symbol": spirit,
        			                        "symbolSize": 22.5,
        			                        "symbolBoundingData": result.maxvalue,
        			                        "symbolPosition": "start",
        			                        "symbolOffset": [
        			                          20,
        			                          0
        			                        ],
        			                        "data":  result.integral,
        			                        "z": 5
        			                      }
        			                    ]
        			                };
        				  }
        				});
        		});             
                
                
            	clearTimeout(loadingTicket);
            	loadingTicket = setTimeout(function (){
            	    myChart.hideLoading();
            	    myChart.setOption(option);
            	},2200);

        	    myChart.on('click', function (params) {
        	    	$("#checkchart").modal('show');
        	    });
            // 为echarts对象加载数据 
           // myChart.setOption(option); 

    </script>
</body>
</html>